﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddressEditor.ascx.cs"
    Inherits="NetDon.OA.Portal.Controls.AddressEditor" %>
<%@ Register Src="RequiredMark.ascx" TagName="RequiredMark" TagPrefix="uc1" %>

<script language="javascript" type="text/javascript">
    function <%=ClientID %>_StatesPopulated() { 
        var markStatePanel = $get('<%=markStatePanel.ClientID %>');
        if(markStatePanel){
            var ddlState=$get('<%=ddlState.ClientID %>');
            $common.setVisible(markStatePanel,ddlState.options.length&&!(ddlState.options.length==1&&!ddlState.options[0].value));
        }
    }
</script>

<NetDon:FormPanel runat="server" ID="fpAddress" RepeatColumns="2">
    <Items>
        <NetDon:FormItem HeaderText="Line 1" FullRow="true">
            <ContentTemplate>
                <asp:TextBox ID="txtAddressLine1" runat="server" Width="477px" MaxLength="60"></asp:TextBox>
                <uc1:RequiredMark ID="markAddressLine1" runat="server" />
            </ContentTemplate>
        </NetDon:FormItem>
        <NetDon:FormItem HeaderText="Line 2" FullRow="true">
            <ContentTemplate>
                <asp:TextBox ID="txtAddressLine2" runat="server" Width="477px" MaxLength="60"></asp:TextBox>
            </ContentTemplate>
        </NetDon:FormItem>
        <NetDon:FormItem HeaderText="City">
            <ContentTemplate>
                <asp:TextBox ID="txtCity" runat="server" MaxLength="60"></asp:TextBox>
            </ContentTemplate>
        </NetDon:FormItem>
        <NetDon:FormItem HeaderText="Zip Code">
            <ContentTemplate>
                <asp:TextBox ID="txtPostCode" runat="server" MaxLength="40"></asp:TextBox>
                <uc1:RequiredMark ID="markPostCode" runat="server" />
            </ContentTemplate>
        </NetDon:FormItem>
        <NetDon:FormItem HeaderText="Country">
            <ContentTemplate>
                <asp:DropDownList ID="ddlCountry" runat="server" AppendDataBoundItems="true" DataTextField="CountryName"
                    DataValueField="CountryId">
                </asp:DropDownList>
                <asp:CascadingDropDown ID="ddlCountry_CascadingDropDown" runat="server" Enabled="True"
                    TargetControlID="ddlCountry" LoadingText="Loading countries..." PromptText="Please select a country"
                    Category="Country" ServicePath="~/AjaxService.asmx" ServiceMethod="GetCountries">
                </asp:CascadingDropDown>
                <uc1:RequiredMark ID="markCountry" runat="server" />
            </ContentTemplate>
        </NetDon:FormItem>
        <NetDon:FormItem HeaderText="State">
            <ContentTemplate>
                <asp:DropDownList ID="ddlState" runat="server">
                </asp:DropDownList>
                <asp:CascadingDropDown ID="ddlState_CascadingDropDown" runat="server" Enabled="True"
                    LoadingText="Loading states..." ParentControlID="ddlCountry" PromptText="Please select a state"
                    ServiceMethod="GetStates" TargetControlID="ddlState" Category="State" ServicePath="~/AjaxService.asmx">
                </asp:CascadingDropDown>
                <span runat="server" ID="markStatePanel">
                    <uc1:RequiredMark ID="markState" runat="server" />
                </span>
            </ContentTemplate>
        </NetDon:FormItem>
    </Items>
</NetDon:FormPanel>
